package com.gzyz.cheetah.entity.table;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.gzyz.cheetah.enums.entityproperty.DocumentCommentStatus;
import com.gzyz.cheetah.enums.entityproperty.DocumentIsPublic;
import com.gzyz.cheetah.enums.entityproperty.DocumentStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 文档表
 * </p>
 *
 * @author xclhove
 * @since 2023-11-06
 */
@Data
@TableName(value = "document", autoResultMap = true)
@ApiModel(value = "Document对象", description = "文档表")
public class Document implements Serializable {
    
    @ApiModelProperty(value = "文档id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    
    @ApiModelProperty(value = "标题")
    private String title;
    
    @ApiModelProperty(value = "文档路径")
    @JsonIgnore
    private String filePath;
    
    @ApiModelProperty(value = "文档大小")
    private Long size;
    
    @ApiModelProperty(value = "状态(1:正常 2：冻结)")
    private DocumentStatus status;
    
    @ApiModelProperty(value = "是否公开（0：否 1：是）")
    private DocumentIsPublic isPublic;
    
    @ApiModelProperty(value = "用户id")
    private Integer userId;
    
    @ApiModelProperty(value = "评论区状态(默认开启 0:关闭 1:开启)")
    private DocumentCommentStatus commentStatus;
    
    @ApiModelProperty(value = "上传时间")
    private LocalDateTime createTime;
    
    @ApiModelProperty(value = "修改时间")
    private LocalDateTime updateTime;
    
    @ApiModelProperty(value = "关键词")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<Keyword> keywords;
}
